package gui;

import javax.swing.JPanel;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.factories.FormFactory;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.JTextField;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JComboBox;

public class AppPanelFaction extends JPanel {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 3532086094480804100L;
	public static JButton btnChapterCreate = new JButton("Create");
	public static JButton btnChapterDelete = new JButton("Delete");
	public static JButton btnChapterEdit = new JButton("Save");
	public static JTextField txtFactionShortName = new JTextField();
	public static JTextField txtFactionName = new JTextField();
	public static JScrollPane scrollFaction = new JScrollPane();
	public static JTextArea taFactionDesc = new JTextArea();
	public static JLabel lblFactionAffilation = new JLabel("Affilation");
	public static JLabel lblFactionRole = new JLabel("Role");
	public static JComboBox dropFactionAffilation = new JComboBox();
	public static JComboBox dropFactionRole = new JComboBox();
	private final JLabel lblShortname = new JLabel("Shortname");
	private final JLabel lblFullname = new JLabel("Faction Name");
	
	
	
	/**
	 * Create the panel.
	 */
	public AppPanelFaction() {
		txtFactionShortName.setText("ShortName");
		txtFactionShortName.setColumns(10);
		setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("75px"),
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("max(150px;default):grow"),
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("max(150px;default):grow"),
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("default:grow"),
				FormFactory.RELATED_GAP_COLSPEC,
				FormFactory.DEFAULT_COLSPEC,},
			new RowSpec[] {
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				RowSpec.decode("default:grow"),
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,
				FormFactory.RELATED_GAP_ROWSPEC,
				FormFactory.DEFAULT_ROWSPEC,}));
		
		add(lblShortname, "4, 2");
		
		add(lblFullname, "6, 2");
		add(btnChapterEdit, "2, 4");
		
		add(txtFactionShortName, "4, 4, fill, default");
		txtFactionName.setText("Name");
		txtFactionName.setColumns(10);
		
		add(txtFactionName, "6, 4, 3, 1, fill, default");
		add(btnChapterDelete, "2, 6");
		
		add(scrollFaction, "4, 6, 5, 5, fill, fill");
		taFactionDesc.setLineWrap(true);
		taFactionDesc.setWrapStyleWord(true);
		
		scrollFaction.setViewportView(taFactionDesc);
		add(btnChapterCreate, "2, 8");
		
		add(lblFactionAffilation, "4, 12");
		
		add(lblFactionRole, "6, 12");
		
		add(dropFactionAffilation, "4, 14, fill, default");
		
		add(dropFactionRole, "6, 14, fill, default");
	}

}
